package com.CMS.server.domain;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = EntityTokens.PRIVILEGE_TABLE)
public class Privilege extends BaseEntity{

	/**
	 * 
	 */
	private static final long serialVersionUID = 3421444525612164588L;

	public Privilege(){
		super();
	}
	
	@ManyToOne(cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
	protected PrivilegeType type;
	
	@ManyToOne(cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
	protected PrivilegeView path;
	
	public void setType(PrivilegeType type){
		this.type = type;
	}
	
	public void setPath(PrivilegeView path){
		this.path = path;
	}
	
	public PrivilegeType getType(){
		return this.type;
	}
	
	public PrivilegeView getPath(){
		return this.path;
	}

}
